package com.baomidou.springmvc.interceptor;

import java.io.IOException;

import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;

import org.apache.log4j.Logger;
/**
 * 
 * @author hewei
 * @ClassName: MyXssFilter
 * @Copyright beauty_tech
 * @date 2018年2月6日 上午10:39:35
 * @description 防跨站脚本攻击过滤器
 */
//@WebFilter(filterName="xssMyfilter",urlPatterns="/*")   
public class MyXssFilter implements Filter{  
  
   
	private static Logger log = Logger.getLogger(MyXssFilter.class);
    @Override  
    public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)  
            throws IOException, ServletException {  
        XsslHttpServletRequestWrapper xssRequest = new XsslHttpServletRequestWrapper((HttpServletRequest)request);  
        chain.doFilter(xssRequest , response);   
    }  
      
    @Override  
    public void destroy() {  
          
    }

	@Override
	public void init(FilterConfig arg0) throws ServletException {
		// TODO Auto-generated method stub
		
	}  
      
}  
